﻿using SPW.LogIn.Views;
using Prism.Ioc;
using Prism.Modularity;
using Prism.Regions;
using System.Linq;
using SPW.Infrastructure.Interfaces;
using System.Windows.Controls;
using SyntacticSugar;

namespace SPW.LogIn
{
    public class LogInModule : IModule
    {
        public void OnInitialized(IContainerProvider containerProvider)
        {

        }

        public void RegisterTypes(IContainerRegistry containerRegistry)
        {
            //注册接口与实例关系
            this.GetType().Assembly.ExportedTypes
                .Where(t => t.BaseType == typeof(UserControl) && t.GetInterfaceMap(typeof(ILogInView)).TargetType.IsValuable())
                .TryForEach(h => containerRegistry.Register(typeof(ILogInView), h, h.Name));
        }
    }
}